package com.boot.security.server.dao.mffl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import com.boot.security.server.model.mffl.MfflInfomationContent;

@Mapper
public interface MfflInfomationContentDao {

    @Select("select * from mffl_infomation_content t where t.info_id = #{infoId}")
    MfflInfomationContent getById(@Param("infoId") Long id);

    @Delete("delete from mffl_infomation_content where info_id = #{id}")
    int delete(Long id);

    int update(MfflInfomationContent mfflInfomationContent);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into mffl_infomation_content(info_id, content) values(#{infoId}, #{content})")
    int save(MfflInfomationContent mfflInfomationContent);

    int count(@Param("params") Map<String, Object> params);

    List<MfflInfomationContent> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);

    //我的话题-修改内容
    @Update("update mffl_infomation_content set content = #{content} where info_id = #{informationId}")
    void updateContentById(@Param("informationId") long informationId, @Param("content") String content);

}
